import PageTools from './PageTools'
import UploadExcel from './UploadExcel'
import moment from 'moment'
import ImageUpload from './ImageUpload'
import store from '@/store'
import Screenfull from './Screenfull'
import LangSelect from './LangSelect'
import ThemePicker from './ThemePicker'
import TagsView from './TagsView'
export default {
  install(Vue) {
    Vue.component('PageTools', PageTools)
    Vue.component('UploadExcel', UploadExcel)
    Vue.component('ImageUpload', ImageUpload)
    Vue.component('Screenfull', Screenfull)
    Vue.component('LangSelect', LangSelect)
    Vue.component('ThemePicker', ThemePicker)
    Vue.component('TagsView', TagsView)
    Vue.filter('dateFormat', (value) => {
      return moment(value).format('YYYY-MM-DD')
    })
    Vue.prototype.$check = function(point) {
      const points = store.state.user.userInfo.roles.points
      return points.includes(point)
    }
  }
}
